const mongoose = require("mongoose");
module.exports = new Promise((resolve,reject)=>{
    mongoose.connect("mongodb://localhost:27017/students",{useNewUrlParser:true,useUnifiedTopology:true,useCreateIndex:true});
    mongoose.connection.once("open",err=>{
        if(err){
            console.log(err);
            reject(err);
        }else{
            console.log("数据库连接成功！！！")
            resolve();
        }
    })
})